<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<%@include file="/common/javascript.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>浏览资源</title>
    <script type="text/javascript">
    
    	$(function (){
    		 $("#tree").ligerTree({ data: [ ${cListTree} ],
    			 onClick: onClick, checkbox: false, parentIcon: 'folder', childIcon: 'leaf', nodeWidth: 300});
    	});
    	
    	$(document).ready(function ()
    	{
    		var parent=window.parent;
    		parent.$("#clistViewList").css("width", "99.5%");
    		parent.$("#clistViewList").css("height", "98%"); 
    	});
    	
    	function onClick(note){
    		var FileType = "flv";
    		var FileName =note.data.text;
    		var parent=window.parent;
    		FileExt=FileName.substring(FileName.lastIndexOf('.')+1, FileName.length).toLowerCase();
    		if(FileExt == "flv"){//播放flv文件
    			/**
    			var dialog=parent.$.ligerDialog.open({url: '${ctx}/qso/clistView/play?pType=flv&id='+note.data.id,height:560, 
    					isHidden: false, width:700, showMax: true, showToggle: true, showMin: true, 
    					isResize: true, modal: true, title:"播放", onBeforeClose:
    					function() {
	        				dialog.close(); 
	        				},
	      					buttons:[{text:"取消",onclick:function(item,d){
								dialog.close();}}]
	        				});
    			*/
    			var pid=note.data.id;
    			window.open("${ctx}/qso/clistView/play?pType=flv&id="+pid,
    					"playView","height=510,width=670,left=300,top=100,scrollbars=yes,resizable=yes");
    		}
    		/*
    		else if(FileExt == "pdf")
    		{
    			var dialog=parent.$.ligerDialog.open({url: '${ctx}/qso/clistView/play?pType=pdf&id='+encodeURI(FileName),height:640, 
					isHidden: false, width:1080, showMax: true, showToggle: true, showMin: true, 
					isResize: true, modal: true, title:"播放", onBeforeClose:
					function() {
        				dialog.close(); 
        				},
        			close: function() { alert("123");},
      					buttons:[{text:"取消",onclick:function(item,d){
							dialog.close();}}]
        				});
    		}
    		*/
    		else if(FileExt == "swf")
    		{
    			/**
    			var dialog=parent.$.ligerDialog.open({url: '${ctx}/qso/clistView/play?pType=swf&id='+encodeURI(FileName),height:640, 
					isHidden: false, width:950, showMax: true, showToggle: true, showMin: true, 
					isResize: true, modal: true, title:"播放", onBeforeClose:
					function() {
        				dialog.close();
        				parent.window.location.reload(true);
        			},
        			close: function() {},
      				buttons:[{text:"取消",onclick:function(item,d){
							dialog.close();}}]
        		});
    			*/
    			window.open('${ctx}/qso/clistView/play?pType=swf&id='+encodeURI(FileName),
    					"playView","height=600,width=950,left=200,top=50,scrollbars=yes,resizable=yes");
    		}
    		else
    		{	//下载文件
    			return false;
    			//download(note.data.id);
    		}
    	}
    	
    	function download(id){
    		 var url='${ctx}/qso/clistView/downloadFile?id='+id;
    		 window.location = url;
    		 return false;
    	 }
    </script>
</head>
<body style="padding:0px;">  
<ul id="tree"></ul>
</body>
</html>
